<?php include $this->header();?>
<?php if(false) {?>
<link rel="stylesheet" rev="stylesheet" href="../../../images/admincp/style.css" type="text/css" media="all" />
<?php }?>
<div class="wrap">
<form id="form" method="post" enctype="application/x-www-form-urlencoded" target="_self" onsubmit="return Validator.Validate(this)">
<?php if(!empty($_GET['role_type'])) {?>
<input type="hidden" name="role_type" value="<?=$_GET['role_type']?>" />
<?php }?>
<div class="bd p1 mt">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="rank">
    <tr>
        <td width="140" align="right" valign="middle">登陆用户名</td>
        <td><input name="user_name" type="text" class="text-box" id="user_name" onblur="Validator.check(this)" size="25" dataType="Require" msg="请填写角色名称" /> <b class="red">*</b> <span class="note">（登录时，输入这个账号，只能填写英文）</span></td>
    </tr>
    <tr>
        <td width="140" align="right" valign="middle">密码</td>
        <td><input name="user_pass" type="password" class="text-box" id="user_pass" onblur="Validator.check(this)" size="25" dataType="Require" msg="请填写角色名称" /> <b class="red">*</b></td>
    </tr>
    <tr>
        <td width="140" align="right" valign="middle">确认密码</td>
        <td><input name="user_pass_check" type="password" class="text-box" id="user_pass_check" onblur="Validator.check(this)" size="25" dataType="Repeat" to="user_pass" msg="两次输入的密码不一致" /> <b class="red">*</b></td>
    </tr>
    <?php if($_SESSION['user_type']=='super'){?>
    <tr>
        <td align="right" valign="middle">管理员类型</td>
        <td>
            <input name="user_type" type="radio" id="radio" value="admin" checked="checked" onclick="$('#acl-set').show();$('.admin_role').removeAttr('disabled');" />普通管理员 
            <input name="user_type" type="radio" id="radio2" value="super" onclick="$('#acl-set').hide();$('.admin_role').attr('disabled', 'disabled');" />超级管理员
        </td>
    </tr>
    <tr id="acl-set">
        <td align="right" valign="middle">权限角色</td>
        <td>
          <ul>
            <?php foreach($adminRoles as $k => $role) {?>
            <li><input name="admin_role[]" type="checkbox" value="<?=$role['role_id']?>" class="admin_role" id="admin_role_<?=$role['role_id']?>"  /> <?=$role['role_name']?></li>
            <?php unset($k);}?>
          </ul>
        </td>
    </tr>
    <?php }?>
    <tr>
        <td width="140" align="right" valign="middle">姓名</td>
        <td><input name="user_realname" type="text" class="text-box" id="user_realname" size="25" /></td>
    </tr>
    <tr>
        <td width="140" align="right" valign="middle">编号</td>
        <td><input name="user_sn" type="text" class="text-box" id="user_sn" size="25" /></td>
    </tr>
    <tr>
        <td width="140" align="right" valign="middle">部门</td>
        <td><input name="user_dept" type="text" class="text-box" id="user_dept"size="25" /></td>
    </tr>
    <tr>
        <td align="right" valign="middle">描述</td>
        <td><textarea name="user_desc" cols="60" rows="6" id="user_desc"></textarea></td>
    </tr>
    <tr>
        <td align="right" valign="middle" class="nobd">启用</td>
        <td class="nobd"><input name="user_enabled" type="radio" id="radio3" value="1" checked="checked" />
            是 
                <input name="user_enabled" type="radio" id="radio4" value="0" />
                否</td>
    </tr>
    <tr>
        <td align="right" valign="middle" class="nobd">&nbsp;</td>
        <td class="nobd"><input class="btn" type="submit" value="添加" /><input name="重置" type="reset" class="btn" value="重置"  onclick="$('#acl-set').show();$('.admin_role').removeAttr('disabled');"/></td>
    </tr>
</table>
</div>
</form>
</div>

<script type="text/javascript">
// <![CDATA[


// ]]>
</script>

<?php include $this->footer();?>